<?php

namespace app\api\controller\v1;

use app\common\controller\BaseController;
use app\common\model\TaskClass as TaskClassModel;
use app\common\validate\TaskClassValidate;

class TaskClass extends BaseController
{
    public function index()
    {
        // 获取任务分类列表
        $list=(new TaskClassModel)->getTaskClassList();
        return self::showResCode('获取成功',['list'=>$list]);
    }

    /**
     * @return bool
     */
    public function task()
    {
        // 验证分类id和分页
        (new TaskClassValidate())->goCheck();
        $list = (new TaskClassModel())->getTask();
        return self::showResCode('获取成功', ['list'=>$list]);
    }

}
